<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>scantable</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="scans.html" title="scans" />
    <link rel="next" href="scanu.html" title="scanu" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">scantable</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="scans.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="scanu.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="scantable"></a>
      <div class="titlepage"></div>
      <a id="IndexScantable" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">scantable</span>
        </h2>
        <p>scantable — 
      A simpler scanned synthesis implementation.
          </p>
      </div>
      <div class="refsect1">
        <a id="idp144158784"></a>
        <h2>Description</h2>
        <p>
      A simpler scanned synthesis implementation. This is an implementation of a circular string scanned using external tables. This opcode will allow direct modification and reading of values with the table opcodes.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp144160400"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">aout <span class="command"><strong>scantable</strong></span> kamp, kpch, ipos, imass, istiff, idamp, ivel</pre>
      </div>
      <div class="refsect1">
        <a id="idp144162512"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ipos</em></span> -- table containing position array.
    </p>
        <p>
      <span class="emphasis"><em>imass</em></span> -- table containing the mass of the string.
    </p>
        <p>
      <span class="emphasis"><em>istiff</em></span> -- table containing the stiffness of the string.
    </p>
        <p>
      <span class="emphasis"><em>idamp</em></span> -- table containing the damping factors of the string.
    </p>
        <p>
      <span class="emphasis"><em>ivel</em></span> -- table containing the velocities.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp144168048"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>kamp</em></span> -- amplitude (gain) of the string.
    </p>
        <p>
      <span class="emphasis"><em>kpch</em></span> -- the string's scanned frequency.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp144170704"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the scantable opcode. It uses the file <a class="ulink" href="examples/scantable.csd" target="_top"><em class="citetitle">scantable.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp144172480"></a>
          <p class="title">
            <strong>Example 783. Example of the scantable opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac -+rtmidi=virtual -M0 <span class="comment">;;;realtime audio out and midi in</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if realtime audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o scantable.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 32
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span>  <span class="op">=</span> 1

gi1 <span class="ohdr">ftgen</span> 1, 0, 128, 7, 0, 64, 1, 64, 0		<span class="comment">; initial position</span>
gi2 <span class="ohdr">ftgen</span> 2, 0, 128, <span class="op">-</span>7, 1, 128, 1		<span class="comment">; masses</span>
gi3 <span class="ohdr">ftgen</span> 3, 0, 128, <span class="op">-</span>7, 0, 64, 100, 64, 0	<span class="comment">; stiffness</span>
gi4 <span class="ohdr">ftgen</span> 4, 0, 128, <span class="op">-</span>7, 1, 128, 1		<span class="comment">; damping</span>
gi5 <span class="ohdr">ftgen</span> 5, 0, 128, <span class="op">-</span>7, 0, 128, 0.5		<span class="comment">; initial velocity</span>


<span class="oblock">instr</span> 1

iamp <span class="opc">ampmidi</span> .5
ipch <span class="opc">cpsmidi</span> 
kenv <span class="opc">madsr</span> .1, .1, .8, .3

asig <span class="opc">scantable</span> iamp, ipch, 1, 2, 3, 4, 5
asig <span class="opc">dcblock</span> asig
     <span class="opc">outs</span> asig<span class="op">*</span>kenv, asig<span class="op">*</span>kenv

<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="stamnt">f</span>0 60	<span class="comment">; play for 60 seconds</span>
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp144176768"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="scanhammer.html" title="scanhammer"><em class="citetitle">scanhammer</em></a>
    </p>
        <p> More information on this opcode: <a class="ulink" href="http://www.csounds.com/stevenyi/scanned/yi_scannedSynthesis.html" target="_top"><em class="citetitle">http://www.csounds.com/stevenyi/scanned/yi_scannedSynthesis.html</em></a>  , written by Steven Yi </p>
      </div>
      <div class="refsect1">
        <a id="idp144180272"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Matt Gilliard</td>
          </tr>
          <tr>
            <td>April 2002</td>
          </tr>
        </table>
        <p>
    </p>
        <p>New in version 4.20</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="scans.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="scanu.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">scans </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> scanu</td>
        </tr>
      </table>
    </div>
  </body>
</html>
